package com.shop.dingdongshoppingapi.controller;

import com.shop.dingdongshoppingapi.config.SystemConfig;
import com.shop.dingdongshoppingapi.service.intf.GoodsService;
import com.shop.dingdongshoppingapi.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@Api(tags = "搜索的测试")
@RequestMapping("api/dd/")
@CrossOrigin
public class GoodsController {
    @Autowired
    private GoodsService service;
    @ApiOperation(value = "搜索")
    @GetMapping ("search.do")
    public R search(String name, Integer type, HttpServletRequest request){
        return service.search(name,type,request.getIntHeader(SystemConfig.TOKEN_HEADER));
    }
}
